﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace 用户登录
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void txtname_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (txtname.Text.Length < 10)
            {
                labuser.Content = "";

            }
            else 
            {
                labuser.Content = "用户名长度要小于10！";
                txtname.Focus();

            }
        }

        private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            if (txtpass.Password.Length < 10)
            {
                labpass.Content = "";

            }
            else
            {
                labpass.Content = "用户名长度要小于10！";
                txtpass.Focus();

            }
        }
    }
}
